/**
 *Copyright (c) 2003, 2018, UMF and/or its affiliates. All rights reserved.
 */
package com.umf.b2b.model.pay;

import com.umf.b2b.MerchantBaseRequest;
import com.umpay.dto.UMFResponse.Message;
import com.umpay.util.UMFUtil;

/**
<p>Title:PaymentQuickOrder</p>  
<p>Description:���п����֧��</p>
 */
public class PaymentQuickOrder extends MerchantBaseRequest{
	
	private String notify_url;//����ѡ��
	private String trade_no;//*����ش���[��Ӧ����],����������ţ���������������ƽ̨���صĶ�����
	private String mer_trace;//*����ش���[��Ӧ����],�̻�֧����ˮ���̻�ƽ̨���ɵı�ʶ�ñ�֧�����׵�Ψһ��ˮ�ţ�����ˮ�ű���Ψһ
	private String amount;//*����ش���֧������������ң���λΪ��
	private String mer_cust_id;//*����ش������̻���ţ��̻�ƽ̨�����̻������Ψһ���
	
	//card_id��p_agreement_id��ѡһ���״�֧��δ�����ʱ��дcard_id�����״ΰ����ʱ��дp_agreement_id
	private String card_id;//����ѡ�[��Ӧ����]
	private String p_agreement_id;//����ѡ��
	private String url = "/payment/quick/order";
	
	
	private String card_type;//[��Ӧ����]���п����ͣ�CREDITCARD�����ÿ�����DEBITCARD����ǿ���
	private String gate_id;//[��Ӧ����]�����б�ţ���������б�
	private String pay_elements;//[��Ӧ����]֧����֤Ҫ���б���һ���ӿ�����Ҫ���͸����������֧��Ҫ����Ϣ����������д������Э����򱾳�һ�㷵���ǿգ�����һ������Ҫ����֧��Ҫ����Ϣ��

	@Override
	public String getRequestUrl() {
		return baseUrl + url;
	}

	@Override
	public PaymentQuickOrder doRequest() throws Exception {
		Message<PaymentQuickOrder> response = UMFUtil.post(createAPIContext(), this,PaymentQuickOrder.class);
		MerchantBaseRequest baseResult = convertResult(response, PaymentQuickOrder.class);
		if(baseResult == null)
			return null;
		return (PaymentQuickOrder)baseResult;
	}

	public String getMer_id() {
		return mer_id;
	}

	public void setMer_id(String mer_id) {
		this.mer_id = mer_id;
	}

	public String getNotify_url() {
		return notify_url;
	}

	public void setNotify_url(String notify_url) {
		this.notify_url = notify_url;
	}

	public String getMer_trace() {
		return mer_trace;
	}

	public void setMer_trace(String mer_trace) {
		this.mer_trace = mer_trace;
	}

	public String getTrade_no() {
		return trade_no;
	}

	public void setTrade_no(String trade_no) {
		this.trade_no = trade_no;
	}

	public String getAmount() {
		return amount;
	}

	public void setAmount(String amount) {
		this.amount = amount;
	}

	public String getMer_cust_id() {
		return mer_cust_id;
	}

	public void setMer_cust_id(String mer_cust_id) {
		this.mer_cust_id = mer_cust_id;
	}

	public String getCard_type() {
		return card_type;
	}

	public void setCard_type(String card_type) {
		this.card_type = card_type;
	}

	public String getGate_id() {
		return gate_id;
	}

	public void setGate_id(String gate_id) {
		this.gate_id = gate_id;
	}

	public String getCard_id() {
		return card_id;
	}

	public void setCard_id(String card_id) {
		this.card_id = card_id;
	}

	public String getP_agreement_id() {
		return p_agreement_id;
	}

	public void setP_agreement_id(String p_agreement_id) {
		this.p_agreement_id = p_agreement_id;
	}

	public String getPay_elements() {
		return pay_elements;
	}

	public void setPay_elements(String pay_elements) {
		this.pay_elements = pay_elements;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("PaymentQuickOrder [notify_url=");
		builder.append(notify_url);
		builder.append(", trade_no=");
		builder.append(trade_no);
		builder.append(", mer_trace=");
		builder.append(mer_trace);
		builder.append(", amount=");
		builder.append(amount);
		builder.append(", mer_cust_id=");
		builder.append(mer_cust_id);
		builder.append(", card_id=");
		builder.append(card_id);
		builder.append(", p_agreement_id=");
		builder.append(p_agreement_id);
		builder.append(", url=");
		builder.append(url);
		builder.append(", card_type=");
		builder.append(card_type);
		builder.append(", gate_id=");
		builder.append(gate_id);
		builder.append(", pay_elements=");
		builder.append(pay_elements);
		builder.append(", version=");
		builder.append(version);
		builder.append(", mer_id=");
		builder.append(mer_id);
		builder.append(", ret_code=");
		builder.append(ret_code);
		builder.append(", ret_msg=");
		builder.append(ret_msg);
		builder.append(", links=");
		builder.append(links);
		builder.append("]");
		return builder.toString();
	}

}
